
********************************************************************************
* Analyzing the University Experiments
********************************************************************************

* Paul Musgrave
* musgrave@umass.edu

********************************************************************************
*								Installations								   *
********************************************************************************

/* You may have to install

ssc install cleanplots
ssc install coefplot
ssc install revrs
ssc install estout
ssc install esttab

*/ 

********************************************************************************
* Importing Data and Stata Cruft
********************************************************************************

clear all

set more off

macro drop _all

global MyDocs "~/Dropbox/0001 Academic Projects/Completed/"

global MyProject "${MyDocs}0171 Parasecurity and Education/Replication"

log using "${MyProject}/LOG Analysis University 2025 09 22"

use "${MyProject}/University Replication.dta"


set scheme cleanplots


* Cleaning

clonevar prc1_DV_main_trichot = prc1_DV_main
recode prc1_DV_main_trichot (1/2= 1) (3=2) (4/5=3)
lab def support3lab 1 "Oppose" 2 "Neither" 3 "Support"
lab val prc1_DV_main_trichot support3lab


clonevar prc2_DV_main_trichot = prc2_DV_main
recode prc2_DV_main_trichot (1/2= 1) (3=2) (4/5=3)
lab val prc2_DV_main_trichot support3lab


********************************************************************************
* Macros
********************************************************************************

local demographics c.age##c.age female white hispanic college i.pid3alt

local technical i.mobile 


********************************************************************************
* Trust Analysis
********************************************************************************

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
* Create New Variables
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 


* Gen state control variable; set to 1 (for mixed), 0 (for D trifecta), or 2 
* (for R trifecta) depending on state government (leg + gov) control as of 
* survey date

gen state_control = .

replace state_control = 1 if inlist(state, "AK","AZ","KS","KY","LA","NV","NC")
replace state_control = 1 if inlist(state, "PA","VT","VA","WI")
replace state_control = 0 if inlist(state, "WA","RI","OR","NY","NM","NJ","MA")
replace state_control = 0 if inlist(state, "MD","ME","IL","HI","DE","CT","CO")
replace state_control = 0 if inlist(state, "CA", "MI","MN","DC")
replace state_control = 2 if inlist(state, "AL","AR","FL","GA","ID","IN","IA")
replace state_control = 2 if inlist(state, "MS","MO","MT","NE","NH","ND","OH")
replace state_control = 2 if inlist(state, "OK","SC","SD","TN","TX","UT","WV",	///
											"WY")
											
lab def statecontrollab 0 "Dem" 1 "Mixed" 2 "GOP"
lab val state_control statecontrollab
lab var state_control "State Government Control"

* Gen a variable to indicate if there is a partisan match between respondent and
* party control

gen state_control_match = .
replace state_control_match = 1 if state_control == pid3alt
replace state_control_match = 0 if state_control != pid3alt
lab var state_control_match "State Partisan Congruence"

* create an indicator for states with fewer than 15 respondents (< 5% total of sample)

gen small_state = 0
replace small_state = 1 if inlist(state,"ND","SD","MT","ME","ID","VT","RI","NE")
replace small_state = 1 if inlist(state,"HI","NH","DE","DC","IA")

* Create a numeric state variable to provide state controls

encode state, gen(state_num)


* Create an indicator for whether respondent trusts states or feds more

gen trust_fed_more = .
replace trust_fed_more = 2 if trust_fed_num > trust_state_num & trust_fed_num != .
replace trust_fed_more = 1 if trust_fed_num == trust_state_num & trust_fed_num != .
replace trust_fed_more = 0 if trust_fed_num < trust_state_num & trust_fed_num != .

lab def trustmorelab 2 "Trust Fed More" 1 "Trust Equally" 0 "Trust State More"
lab var trust_fed_more "Relative Trust in Govt Level"
lab val trust_fed_more trustmorelab

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
* Summary
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 

dtable i.trust_fed_more, by(pid3alt)



* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
* Modeling
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 

// hhi_num_alt is not a significant predictor throughout //

* Modeling trust in the federal government

mlogit trust_fed_num i.pid3alt i.trust_nondiff  c.age##c.age college female white hispanic
est sto m_trust_fed

mlogit trust_fed_num i.pid3alt##state_control_match i.trust_nondiff  c.age##c.age college female white hispanic

mlogit trust_fed_num i.pid3alt##state_control_match i.trust_nondiff  c.age##c.age college female white hispanic i.state_num if small_state == 0

* Modeling trust in the state government

mlogit trust_state_num i.pid3alt##state_control_match i.trust_nondiff  c.age##c.age college female white hispanic 
est sto m_trust_state

mlogit trust_state_num i.pid3alt##state_control_match i.trust_nondiff c.age##c.age college female white hispanic i.state_num if small_state == 0
est sto m_trust_state_fe

* interaction term between pid3 and state control is not significant
* drop independendts (keep lean-independendts)

mlogit trust_state_num i.pid3alt state_control_match i.trust_nondiff c.age##c.age college female white hispanic i.state_num if small_state == 0 & pid3alt != 1

* Republicans more likely to indicate no trust at all compared to Democrats
* when dropping independents and lean-partisans

mlogit trust_state_num i.pid3 state_control_match i.trust_nondiff c.age##c.age college female white hispanic i.state_num if small_state == 0 & pid3 != 1



* Republicans more likely to trust state more. Control of state makes respondents
* more likely to trust state more and less likely to trust fed more. Republicans
* less likely to trust state more. Drops leaners and independents

mlogit trust_fed_more i.pid3 state_control_match i.trust_nondiff c.age##c.age college female white hispanic if small_state == 0 & pid3 != 1

********************************************************************************
********************************************************************************
********************************************************************************
* 								Experiment 1								   *
********************************************************************************
********************************************************************************
********************************************************************************


* Summary Plot

gen prc1_DV_main_100 = prc1_DV_main_dichot * 100

lab var  prc1_DV_main_100 "Exp. 1 Support"

clonevar prc1_treat_relations2 = prc1_treat_relations
lab def prc1_treat_relations2lab 1 "Expert says hostile" 2 "China says hostile" 3 "No PRC reaction"
lab val prc1_treat_relations2 prc1_treat_relations2lab

graph hbar prc1_DV_main_100														///
		, over(prc1_treat_relations2, label(labsize(vsmall)))					///
		over(prc1_treat_level, label(angle(90) labsize(small)))					///
		bar(1, color(black)) bar(2, color(black))								///
		yline(36.24, lcolor(gs12))												///
		blabel(total, format(%9.2f) position(inside) color(white)) 				///
		ytitle("Percent Supporting Restriction", size(vsmall)) 					///
		title("{bf: A:} {it:Average Support by Treatment Category}"				///
			, size(small) span justification(left))								///
		name(g_exp1_summary, replace) fxsize(40)

		
		
********************************************************************************
* 							Experiment 1: Main DV							   *
********************************************************************************

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
*									OLS										  *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 


****** Demographics

reg prc1_DV_main_dichot ///
		i.prc1_treat_level i.prc1_treat_hostile i.prc1_treat_china				///
		i.prc1_mancheck `technical'	`demographics' 								///
		, robust

est sto prc1_m2_ols
local prc1_m2_olsN = `e(N)'


*** Basic Interaction, Federal x Trust
			
reg prc1_DV_main_dichot ///
		i.prc1_treat_level##i.prc1_trust_level_more 							///
		i.prc1_treat_hostile i.prc1_treat_china									///
		i.prc1_mancheck `technical'	`demographics' 								///
		i.trust_fed_num i.trust_nondiff											///
		, robust

est sto prc1_m4_ols

		
reg prc1_DV_main_dichot ///
		i.prc1_treat_level##i.prc1_trust_level_more 							///
		state_control_match ///
		i.prc1_treat_hostile i.prc1_treat_china									///
		i.prc1_mancheck `technical'	`demographics' 								///
		i.trust_fed_num i.trust_nondiff											///
		if small_state == 0 & pid3alt != 1, robust

est sto prc1_m4_ols_match


*** Basic Interaction, Hostile x Threat
	
reg prc1_DV_main_dichot ///
		i.prc1_treat_level 							///
		i.prc1_treat_hostile##i.threat_prc_num i.prc1_treat_china				///
		i.prc1_mancheck `technical'	`demographics' 								///
		, robust
est sto prc1_m5_ols
local prc1_m5_olsN = `e(N)'

*** Double Interaction, Federal x Trust

reg prc1_DV_main_dichot ///
		i.prc1_treat_level##i.prc1_trust_level_more 							///
		i.prc1_treat_hostile##i.threat_prc_num i.prc1_treat_china				///
		i.prc1_mancheck `technical'	`demographics' 								///
		i.trust_fed_num i.trust_nondiff				///
		, robust
est sto prc1_m6_ols	


*** OLS Coefficient Graph Experiment 1 (Short)
coefplot 																	///
		(prc1_m2_ols,label(Base (`prc1_m2_olsN')))							///
		(prc1_m5_ols	,label(Interaction (`prc1_m5_olsN'))) 				///
		, xline(0,lcolor(black))											///
		order(*prc1_treat_level *prc1_treat_hostile *threat_prc_num *prc1_treat_hostile#*)		///
		headings(2.prc1_treat_level = "{bf:Govt Level}"						///
				1.prc1_treat_hostile = "{bf:China Reaction}"				///
				2.threat_prc_num = "{bf:View of China Threat}"				///
				1.prc1_treat_hostile#2.threat_prc_num  = "{bf:Reaction x Threat}" ///
				1.prc1_treat_china = "{bf:Cuegiver}"					///
				?.prc1_mancheck = "{it:Covariates}"							///
				)															///
		coeflabels(, interaction(" x ") labsize(small)) 					///
		drop(*cons age *.prc1_mancheck age female white hispanic *.college 	///
			*.pid3alt *.mobile)												///
		name(g_exp1_olsshort,replace) 										///
	title("{bf: B:} {it:Support for Restriction by PRC Reaction}" "{it:and Proposing Government}",  ///
			justification(left) span size(medsmall))						///
	xtitle("OLS Coefficients", size(small))									///
	legend(ring(0) pos(11) size(vsmall)  region(color(none)))				///
	note("Full specification includes manipulation check, age, gender,ethnicity, education," "party ID, and survey mode.", size(vsmall) span)
		
* interpretation of the interaction term 

est restore prc1_m5_ols

margins prc1_treat_hostile#threat_prc_num

mplotoffset	///
	, text(.37 .77 "Not a" "threat", color(cranberry)) 							///
	text(.45 .5 "A major threat", color(gray))									///
	text(.2 .25 "A minor threat", color(eltblue))								///
	name(g_exp1_olsinteraction, replace)  legend(off)							///
	title("{bf: C:} {it:Predicted Support for Restriction by PRC Reaction}" "{it:and Threat Perception}", ///
		justification(left) span size(medsmall))								///
	ytitle("Predicted share supporting restriction", size(vsmall)) fysize(40)	///
	note("Calculated from Interaction model in Panel B.", span size(vsmall))			///
	ylab(.1 "10" .2 "20" .3 "30" .4 "40" .5 "50" .6 "60")						///
	plot1opts(lpattern(dash))
	

gr combine g_exp1_olsshort g_exp1_olsinteraction								///
	, rows(2) name(g_temp, replace)
	
gr combine g_exp1_summary g_temp												///
	, rows(1)  xsize(9) ysize(10) 
	/// title("{bf:Experiment 1:} Hostile PRC reaction substantially cuts support" ///
	/// "among respondents who do not view PRC as a threat." 							///
	/// , justification(left) size(medsmall)) xsize(9) ysize(10)
	
gr export "${MyProject}/PAPER Figure 3.pdf", replace
	
	
	
*** Focus on H2 and H2.1
reg prc1_DV_main_dichot i.prc1_treat_level i.prc1_mancheck if fptreat2simple == "No Stance" & prc1_treat_hostile == 0
est sto exp1_m1_china1hostile0

reg prc1_DV_main_dichot i.prc1_treat_level i.prc1_mancheck if fptreat2simple == "Hostile" & prc1_treat_hostile == 1
est sto exp1_m1_china1hostile1


* H2.1
reg prc1_DV_main_dichot i.prc1_treat_level i.prc1_mancheck if prc1_treat_hostile == 0
est sto exp1_m1_hostile0


reg prc1_DV_main_dichot i.prc1_treat_level i.prc1_mancheck if prc1_treat_hostile == 1
est sto exp1_m1_hostile1
		
esttab 			///
	exp1_m1_china1hostile0 exp1_m1_china1hostile1 exp1_m1_hostile0 exp1_m1_hostile1  ///
	using "${MyProject}/APPENDIX Table A6.tex"		///
	, replace longtable lab noomit nobase    ///
			se(%9.1f) b(%9.1f)	star(+ 0.10 * 0.05)	///								///
	title("Experiment 1 H2 and H2.1 Focus Results (OLS) \label{tab:exp1h2}") ///
	mtitles("H2 China No Stance" "H2 China Hostile" "H2.1 No Stance" "H2.1 Hostile (Any)") ///
	refcat(2.prc1_treat_level "\textit{Government Level}"						///
			1.prc1_treat_hostile "\textit{China Reaction}"						///
			1.prc1_treat_china "\textit{Cuegiver}"							///
			1.prc1_mancheck "\textit{Manipulation Check}"						///
			1.mobile "\textit{Survey Mode}"										///
			age "\textit{Covariates}"											///	
			2.trust_fed_num "\textit{Trust in Fed Govt}"						///
			1.trust_nondiff "\textit{Trust Grid Straightlining}"				///
			2.threat_prc_num "\textit{Views of PRC}"							///
			2.prc1_trust_level_more "\textit{Relative Trust}"					///
		, nolabel)																

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
*									Logit										  *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 

****** Treatments and Technical

logit prc1_DV_main_dichot 														///
		i.prc1_treat_level i.prc1_treat_hostile i.prc1_treat_china				///
		i.prc1_mancheck `technical'												///
		, robust

est sto prc1_m1_logit


****** Demographics

logit prc1_DV_main_dichot ///
		i.prc1_treat_level i.prc1_treat_hostile i.prc1_treat_china				///
		i.prc1_mancheck `technical'	`demographics' 								///
		, robust

est sto prc1_m2_logit
local prc1_m2_logitN = `e(N)'


*** Basic Interaction, Federal x Trust
			
logit prc1_DV_main_dichot ///
		i.prc1_treat_level##i.prc1_trust_level_more 							///
		i.prc1_treat_hostile i.prc1_treat_china									///
		i.prc1_mancheck `technical'	`demographics' 								///
		i.trust_fed_num i.trust_nondiff											///
		, robust

est sto prc1_m4_logit


*** Basic Interaction, Hostile x Threat
	
logit prc1_DV_main_dichot ///
		i.prc1_treat_level 							///
		i.prc1_treat_hostile##i.threat_prc_num i.prc1_treat_china				///
		i.prc1_mancheck `technical'	`demographics' 								///
		, robust
est sto prc1_m5_logit
local prc1_m5_logitN = `e(N)'

*** Double Interaction, Federal x Trust

logit prc1_DV_main_dichot ///
		i.prc1_treat_level##i.prc1_trust_level_more 							///
		i.prc1_treat_hostile##i.threat_prc_num i.prc1_treat_china				///
		i.prc1_mancheck `technical'	`demographics' 								///
		i.trust_fed_num i.trust_nondiff				///
		, robust
est sto prc1_m6_logit	

	
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
*									ologit										  *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 

***** Demographics

ologit prc1_DV_main 															///
		i.prc1_treat_level i.prc1_treat_hostile i.prc1_treat_china				///
		i.prc1_mancheck `technical'	`demographics' 								///
		, robust

est sto prc1_m2_ologit

****** Versions with Interactions

*** Basic Interaction, Federal x Trust

ologit prc1_DV_main 															///
		i.prc1_treat_level##i.prc1_trust_level_more 							///
		i.prc1_treat_hostile i.prc1_treat_china									///
		i.prc1_mancheck `technical'	`demographics' 								///
		i.trust_fed_num i.trust_nondiff											///
		, robust

est sto prc1_m4_ologit


*** Basic Interaction, Hostile x Threat
	
ologit prc1_DV_main 															///
		i.prc1_treat_level 														///
		i.prc1_treat_hostile##i.threat_prc_num i.prc1_treat_china				///
		i.prc1_mancheck `technical'	`demographics' 								///
		, robust
est sto prc1_m5_ologit
	
	


*** Double Interaction, Federal x Trust

ologit prc1_DV_main 															///
		i.prc1_treat_level##i.prc1_trust_level_more 							///
		i.prc1_treat_hostile##i.threat_prc_num i.prc1_treat_china				///
		i.prc1_mancheck `technical'	`demographics' 								///
		i.trust_fed_num i.trust_nondiff											///
		, robust
est sto prc1_m6_ologit

***** Table
		
esttab 																			///
	prc1_m2_ols prc1_m2_logit  prc1_m2_ologit 									///
	prc1_m6_ols prc1_m6_logit 	prc1_m6_ologit									///
	using "${MyProject}/APPENDIX Table A5.tex"			///
	, replace longtable lab noomit nobase  nogap compress						///
	se(%9.1f) b(%9.1f)	star(+ 0.10 * 0.051)									///
	drop(*cons *cut*)															///
	refcat(2.prc1_treat_level "\textit{Government Level}"						///
			1.prc1_treat_hostile "\textit{China Reaction}"						///
			1.prc1_treat_china "\textit{Cuegiver}"							///
			1.prc1_mancheck "\textit{Manipulation Check}"						///
			1.mobile "\textit{Survey Mode}"										///
			age "\textit{Covariates}"											///	
			2.trust_fed_num "\textit{Trust in Fed Govt}"						///
			1.trust_nondiff "\textit{Trust Grid Straightlining}"				///
			2.threat_prc_num "\textit{Views of PRC}"							///
			2.prc1_trust_level_more "\textit{Relative Trust}"					///
		, nolabel)																///
	mtitles("OLS" "Logit" "Ologit" "OLS" "Logit"  "Ologit")			///
	indicate("Covariates = age c.age#c.age female white hispanic college 1.pid3alt 2.pid3alt")	///
	nonotes addnote("Robust standard errors in parantheses. Covariates for age, gender, race," "ethnicity, educational attainment, and partisanship included but not displayed." )						///
	title("Experiment 1, Principal Results \label{tab:exp1main}")		
				
					

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
*									mlogit									  *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 

****** Demographics

mlogit prc1_DV_main_trichot 															///
		i.prc1_treat_level i.prc1_treat_hostile i.prc1_treat_china				///
		i.prc1_mancheck `technical'	`demographics' 								///
		, robust base(3)

est sto prc1_m2_mlogit


*** Basic Interaction, Hostile x Threat
	
mlogit prc1_DV_main_trichot 															///
		i.prc1_treat_level 														///
		i.prc1_treat_hostile##i.threat_prc_num i.prc1_treat_china				///
		i.prc1_mancheck `technical'	`demographics' 								///
		, robust base(3)
est sto prc1_m5_mlogit


esttab 			///
	prc1_m2_mlogit  prc1_m5_mlogit ///
	using "${MyProject}/APPENDIX Table A7.tex"		///
	, replace longtable lab noomit nobase  nogap unstack	 					///
	se(%9.1f) b(%9.1f)	star(+ 0.10 * 0.051)									///
	nonotes addnote(Robust standard errors in parantheses)						///
	title("Experiment 1, Multinomial Logit \label{tab:exp1mlogit}")				///
	refcat(2.prc1_treat_level "\textit{Government Level}"						///
			1.prc1_treat_hostile "\textit{China Reaction}"						///
			1.prc1_treat_china "\textit{Cuegiver}"								///
			1.prc1_mancheck "\textit{Manipulation Check}"						///
			1.mobile "\textit{Survey Mode}"										///
			age "\textit{Covariates}"											///	
			2.trust_fed_num "\textit{Trust in Fed Govt}"						///
			1.trust_nondiff "\textit{Trust Grid Straightlining}"				///
			2.threat_prc_num "\textit{Views of PRC}"							///
			2.prc1_trust_level_more "\textit{Relative Trust}"					///
		, nolabel)																
 
		
********************************************************************************
* 							Experiment 1: Effects DV							   *
********************************************************************************

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
*									OLS										  *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 


****** Demographics

reg prc1_DV_effects_dichot ///
		i.prc1_treat_level i.prc1_treat_hostile i.prc1_treat_china				///
		i.prc1_mancheck `technical'	`demographics' 								///
		, robust

est sto prc1_fx_m2_ols
local prc1_fx_m2_olsN = `e(N)'


*** Basic Interaction, Federal x Trust
			
reg prc1_DV_effects_dichot ///
		i.prc1_treat_level##i.prc1_trust_level_more 							///
		i.prc1_treat_hostile i.prc1_treat_china									///
		i.prc1_mancheck `technical'	`demographics' 								///
		i.trust_fed_num i.trust_nondiff											///
		, robust

est sto prc1_fx_m4_ols


*** Basic Interaction, Hostile x Threat
	
reg prc1_DV_effects_dichot ///
		i.prc1_treat_level 							///
		i.prc1_treat_hostile##i.threat_prc_num i.prc1_treat_china				///
		i.prc1_mancheck `technical'	`demographics' 								///
		, robust
est sto prc1_fx_m5_ols
local prc1_fx_m5_olsN = `e(N)'

*** Double Interaction, Federal x Trust

reg prc1_DV_effects_dichot ///
		i.prc1_treat_level##i.prc1_trust_level_more 							///
		i.prc1_treat_hostile##i.threat_prc_num i.prc1_treat_china				///
		i.prc1_mancheck `technical'	`demographics' 								///
		i.trust_fed_num i.trust_nondiff				///
		, robust
est sto prc1_fx_m6_ols	

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
*									Logit										  *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 

****** Treatments and Technical

logit prc1_DV_effects_dichot 														///
		i.prc1_treat_level i.prc1_treat_hostile i.prc1_treat_china				///
		i.prc1_mancheck `technical'												///
		, robust

est sto prc1_fx_m1_logit


****** Demographics

logit prc1_DV_effects_dichot ///
		i.prc1_treat_level i.prc1_treat_hostile i.prc1_treat_china				///
		i.prc1_mancheck `technical'	`demographics' 								///
		, robust

est sto prc1_fx_m2_logit
local prc1_fx_m2_logitN = `e(N)'


*** Basic Interaction, Federal x Trust
			
logit prc1_DV_effects_dichot ///
		i.prc1_treat_level##i.prc1_trust_level_more 							///
		i.prc1_treat_hostile i.prc1_treat_china									///
		i.prc1_mancheck `technical'	`demographics' 								///
		i.trust_fed_num i.trust_nondiff											///
		, robust

est sto prc1_fx_m4_logit


*** Basic Interaction, Hostile x Threat
	
logit prc1_DV_effects_dichot ///
		i.prc1_treat_level 							///
		i.prc1_treat_hostile##i.threat_prc_num i.prc1_treat_china				///
		i.prc1_mancheck `technical'	`demographics' 								///
		, robust
est sto prc1_fx_m5_logit
local prc1_fx_m5_logitN = `e(N)'

*** Double Interaction, Federal x Trust

logit prc1_DV_effects_dichot ///
		i.prc1_treat_level##i.prc1_trust_level_more 							///
		i.prc1_treat_hostile##i.threat_prc_num i.prc1_treat_china				///
		i.prc1_mancheck `technical'	`demographics' 								///
		i.trust_fed_num i.trust_nondiff				///
		, robust
est sto prc1_fx_m6_logit	

* * *                   *
*									Ologit										  *
* * *                   *
****** Treatments and Technical
ologit prc1_DV_effects 															///
		i.prc1_treat_level i.prc1_treat_hostile i.prc1_treat_china				///
		i.prc1_mancheck `technical'												///
		, robust
est sto prc1_fx_m1_ologit
****** Demographics
ologit prc1_DV_effects ///
		i.prc1_treat_level i.prc1_treat_hostile i.prc1_treat_china				///
		i.prc1_mancheck `technical'	`demographics' 								///
		, robust
est sto prc1_fx_m2_ologit
local prc1_fx_m2_ologitN = `e(N)'
*** Basic Interaction, Federal x Trust
			
ologit prc1_DV_effects ///
		i.prc1_treat_level##i.prc1_trust_level_more 							///
		i.prc1_treat_hostile i.prc1_treat_china									///
		i.prc1_mancheck `technical'	`demographics' 								///
		i.trust_fed_num i.trust_nondiff											///
		, robust
est sto prc1_fx_m4_ologit
*** Basic Interaction, Hostile x Threat
	
ologit prc1_DV_effects ///
		i.prc1_treat_level 							///
		i.prc1_treat_hostile##i.threat_prc_num i.prc1_treat_china				///
		i.prc1_mancheck `technical'	`demographics' 								///
		, robust
est sto prc1_fx_m5_ologit
local prc1_fx_m5_ologitN = `e(N)'
*** Double Interaction, Federal x Trust
ologit prc1_DV_effects ///
		i.prc1_treat_level##i.prc1_trust_level_more 							///
		i.prc1_treat_hostile##i.threat_prc_num i.prc1_treat_china				///
		i.prc1_mancheck `technical'	`demographics' 								///
		i.trust_fed_num i.trust_nondiff				///
		, robust
est sto prc1_fx_m6_ologit

*** Table 
		
esttab 																			///
	prc1_fx_m2_ols prc1_fx_m2_logit prc1_fx_m2_ologit							///
	prc1_fx_m6_ols prc1_fx_m6_logit prc1_fx_m6_ologit							///
	using "${MyProject}/APPENDIX Table A8.tex"			///
	, replace longtable lab noomit nobase  nogap	 							///
	se(%9.1f) b(%9.1f)	star(+ 0.10 * 0.051)	drop(*cons* *cut*)				///
	nonotes addnote(Robust standard errors in parantheses)						///
	mtitles("OLS" "Logit" "Ologit" "OLS" "Logit" "Ologit")						///
	refcat(2.prc1_treat_level "\textit{Government Level}"						///
			1.prc1_treat_hostile "\textit{China Reaction}"						///
			1.prc1_treat_china "\textit{Cuegiver}"								///
			1.prc1_mancheck "\textit{Manipulation Check}"						///
			1.mobile "\textit{Survey Mode}"										///
			age "\textit{Covariates}"											///	
			2.trust_fed_num "\textit{Trust in Fed Govt}"						///
			1.trust_nondiff "\textit{Trust Grid Straightlining}"				///
			2.threat_prc_num "\textit{Views of PRC}"							///
			2.prc1_trust_level_more "\textit{Relative Trust}"					///
		, nolabel)				///
		title("Experiment 1 Full Results for Effects DV (Higher = Harm Relationship) \label{tab:exp1fx}")		


	
********************************************************************************
* 							Experiment 1: Subsidiary DV						   *
********************************************************************************

* This code creates variables that allow us to display pretty summaries of the
* subsidiary variables

foreach var in 																	///
					discriminates 												///
					harmuni 													///
					protectusa 													///
					science 													///
					screening 													///
					america1st													///
			{
				clonevar prc1_`var'_100 = prc1_`var'_num
				replace prc1_`var'_100 = 100*prc1_`var'_100
				
			}

* This code creates a pretty summary for the subsidiary variables
			
statplot ///
		prc1_screening_100 														///
		prc1_discriminates_100 													///
		prc1_science_100 														///
		prc1_harmuni_100 														///
		prc1_protectusa_100 													///
		prc1_america1st_100														///
		, name(gph_prc1_subsidiary, replace)									///
		title("Respondents' view of statements (Exp 1)")						///
		ytitle("Average percent agreeing")							

gr export "${MyProject}/APPENDIX Figure A2.pdf", replace

* This code creates a mass analysis of the subsidiary DVs along with saved 
* models for each of them.		

foreach var in 																	///
					discriminates 												///
					harmuni 													///
					protectusa 													///
					science 													///
					screening 													///
					america1st													///
			{

				local demographics age female white hispanic college i.pid3alt

				local technical i.mobile 
			

			*OLS
				quietly: reg prc1_`var'_num i.prc1_treat_level ///
					i.prc1_treat_hostile, robust
				est sto prc1_s`var'_m0_ols
				
				quietly: reg prc1_`var'_num i.prc1_treat_level i.prc1_treat_hostile	///
						`demographics' `technical' , robust
				est sto prc1_s`var'_m2_ols
				
				quietly: reg prc1_`var'_num 	i.prc1_treat_level##i.prc1_trust_level 	///
									i.prc1_treat_hostile##i.threat_prc_2 		 ///
									`demographics' `technical', robust
				est sto prc1_s`var'_m8_ols
				
				quietly: reg prc1_`var'_num 	i.prc1_treat_level##i.threat_prc_2 	///
									i.prc1_treat_hostile##i.threat_prc_2 		 ///
									`demographics' `technical', robust
				est sto prc1_s`var'_m9_ols			
	
	}	
	
	
esttab ///
	prc1_sdiscriminates_m2_ols prc1_sharmuni_m2_ols prc1_sscience_m2_ols			///
	prc1_sprotectusa_m2_ols prc1_samerica1st_m2_ols	prc1_sscreening_m2_ols		///
	using "${MyProject}/APPENDIX Table A9.tex"			///
	, replace longtable lab noomit nobase  nogap  drop(*cons*)			///
	se(%9.1f) b(%9.2f)	star(+ 0.10 * 0.051)									///
	nonotes addnote(Robust standard errors in parantheses)						///
	varwidth(30)						compress								///
	interaction(" x ")															///
	refcat(2.prc1_treat_level "\textit{Government Level}"						///
			1.prc1_treat_hostile "\textit{China Reaction}"						///
			1.prc1_treat_china "\textit{Cuegiver}"								///
			1.prc1_mancheck "\textit{Manipulation Check}"						///
			1.mobile "\textit{Survey Mode}"										///
			age "\textit{Covariates}"											///	
			2.trust_fed_num "\textit{Trust in Fed Govt}"						///
			1.trust_nondiff "\textit{Trust Grid Straightlining}"				///
			2.threat_prc_num "\textit{Views of PRC}"							///
			2.prc1_trust_level_more "\textit{Relative Trust}"					///
		, nolabel)				///
	title("Models of Subsidiary DVs with Demographics \label{tab:exp1secondary}") 		

	
********************************************************************************
* 							Experiment 1: Het Effects						   *
********************************************************************************

*** Flo Rida (Florida) *********************************************************


gen florida = (state == "FL")
lab var florida "Florida"
lab def floridalab 0 "Not Florida" 1 "Florida"
lab val florida floridalab

reg prc1_DV_main_dichot ///
			i.prc1_treat_level##florida 				///
			i.prc1_treat_hostile##florida				 ///
			i.prc1_treat_china##florida 				///
			i.prc1_mancheck mobile age  white hispanic college i.pid3alt		///
			, robust
			
	est sto exp1_florida

coefplot 																		///
	exp1_florida																///
	, keep(*prc1_treat* *.florida* *.florida*)	xline(0)						///
	title("{it:Florida Residence}")												///
		coeflabels(, interaction(" x ") labsize(vsmall)) 						///
	name(g_exp1_florida, replace)		
		


*** Gender *********************************************************************

	reg prc1_DV_main_dichot ///
			i.prc1_treat_level##female ///
			i.prc1_treat_hostile##female ///
			i.prc1_treat_china##female			///
			i.prc1_mancheck mobile age  white hispanic college i.pid3alt		///
			, robust
			
	est sto exp1_female


coefplot 																		///
	exp1_female																	///
	, xline(0)	keep(*prc1_treat* *.florida*)									///
	name(g_female, replace)														///
		coeflabels(, interaction(" x ") labsize(vsmall)) 						///
	title("{it:Gender}")		


*** Degree *********************************************************************

reg prc1_DV_main_dichot ///
			i.prc1_treat_level##college 		///
			i.prc1_treat_hostile##college  	///
			i.prc1_treat_china##college 				///
			i.prc1_mancheck mobile age female white hispanic  i.pid3alt			///
			, robust
	est sto exp1_college

coefplot 																		///
	exp1_college																///
	, keep(*prc1_treat* *.college* *.college*)	xline(0)						///
	name(g_college, replace)													///
		coeflabels(, interaction(" x ") labsize(vsmall)) 						///
	title("{it:Education}")		


*** Man Check ******************************************************************

reg prc1_DV_main_dichot ///
			i.prc1_treat_level##prc1_mancheck		///
			i.prc1_treat_hostile##prc1_mancheck	 	///
			i.prc1_treat_china##prc1_mancheck			///
			i.prc1_mancheck mobile age female white hispanic college b2.pid3alt		///
			, robust
			
	est sto exp1_mancheck

coefplot 																			///
	exp1_mancheck															///
	, keep(*.prc1* )	xline(0)											///
	name(g_mancheck, replace)												///
		coeflabels(, interaction(" x ") labsize(vsmall)) 					///
	title("{it:Manipulation Check}")	

	
est restore exp1_mancheck
margins prc1_treat_level, at(prc1_mancheck = (0 1))
mplotoffset

*** Mobile *******************************************************************

reg prc1_DV_main_dichot ///
		i.prc1_treat_level##mobile ///
		i.prc1_treat_hostile##mobile ///
		i.prc1_treat_china##mobile ///
		i.prc1_mancheck mobile age female white hispanic college i.pid3alt ///
		, robust
est sto exp1_mobile

coefplot 																		///
	exp1_mobile 																///
	, keep(*prc1_treat* *.mobile* *.mobile*) xline(0) 							///
	title("{it:Mobile Device}") 												///
		coeflabels(, interaction(" x ") labsize(vsmall)) 					///
	name(g_exp1_mobile, replace)

	
*** Race ***********************************************************************

gen honky = (white == 1 & hispanic == 0)
lab var honky "White Non-Hispanic"
lab def honkylab 0 "Not White Only" 1 "White Only"
lab val honky honkylab

reg prc1_DV_main_dichot ///
		i.prc1_treat_level##honky ///
		i.prc1_treat_hostile##honky ///
		i.prc1_treat_china##honky ///
		i.prc1_mancheck mobile age female college i.pid3alt ///
		, robust
est sto exp1_honky

coefplot 																		///
	exp1_honky 																	///
	, keep(*prc1_treat* *.honky* *.honky*) xline(0) 							///
	title("{it:Race}") 															///
		coeflabels(, interaction(" x ") labsize(vsmall)) 					///
	name(g_exp1_honky, replace)	


*** PID ***********************************************************************

reg prc1_DV_main_dichot ///
		i.prc1_treat_level##i.pid3alt ///
		i.prc1_treat_hostile##i.pid3alt ///
		i.prc1_treat_china##i.pid3alt ///
		i.prc1_mancheck mobile age female white hispanic college ///
		if pid3alt == 0 | pid3alt == 2 ///
		, robust
est sto exp1_pid3

coefplot 																		///
	exp1_pid3 																	///
	, keep(*prc1_treat* *.pid3alt* *.pid3alt*) xline(0) 						///
	title("{it:Party ID}") 														///
		coeflabels(, interaction(" x ") labsize(vsmall)) 					///
	name(g_exp1_pid3, replace)		


*** Threat *********************************************************************

reg prc1_DV_main_dichot ///
		i.prc1_treat_level##i.threat_prc_num ///
		i.prc1_treat_hostile##i.threat_prc_num ///
		i.prc1_treat_china##i.threat_prc_num ///
		i.prc1_mancheck mobile age female white hispanic college i.pid3alt ///
		, robust
est sto exp1_threat

coefplot 																		///
	exp1_threat 																///
	, keep(*prc1_treat* *.threat_prc_num* *.threat_prc_num*) xline(0) 			///
	title("{it:Threat}") 														///
		coeflabels(, interaction(" x ") labsize(vsmall)) 					///
	name(g_exp1_threat, replace)	



* Combining them	
gr combine g_exp1_florida g_female g_college g_mancheck 						///
	g_exp1_mobile g_exp1_honky g_exp1_pid3 g_exp1_threat						///
	, rows(4) xsize(8) ysize(12) imargins(tiny)

gr export "${MyProject}/APPENDIX Figure A1.pdf", replace
	
	
********************************************************************************
********************************************************************************
********************************************************************************
* 								Experiment 2								   *
********************************************************************************
********************************************************************************
********************************************************************************


* Summary Plot
		
gen prc2_DV_main_100 = prc2_DV_main_dichot * 100

lab var  prc2_DV_main_100 "Exp. 2 Support"

clonevar prc2_treat_usa2 = prc2_treat_usa

lab def prc2_treat_usa2lab 1 "No State Dept stance" 2 "State Dept says undermines"

lab val prc2_treat_usa2 prc2_treat_usa2lab

clonevar prc2_treat_prc2 = prc2_treat_prc

lab def prc2_treat_prc2lab 1 "No PRC stance" 2 "Hostile PRC stance"

lab val prc2_treat_prc2 prc2_treat_prc2lab

graph hbar prc2_DV_main_100														///
		, over(prc2_treat_prc2, label(labsize(vsmall)))							///
		bar(1, color(black)) bar(2, color(black))								///
		over(prc2_treat_usa2, label(angle(90) labsize(small)))					///
		yline(32.18, lcolor(gs12))												///
		blabel(total, format(%9.2f) position(inside) color(white)) 				///
		ytitle("Percent Supporting Restriction", size(vsmall)) 					///
		title("{bf: A:} {it:Average Support by Treatment Category}"				///
			, size(small) span justification(left))								///
		name(g_exp2_summary, replace) fxsize(40)
		

********************************************************************************
* 							Experiment 2: Main DV							   *
********************************************************************************


* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
* OLS
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 

****** Demographics

reg prc2_DV_main_dichot i.prc2_treat_usa i.prc2_treat_prc i.prc2_mancheck 		///
	`demographics' `technical', robust

est sto prc2_m2_ols
local prc2_m2_olsN = `e(N)'


*** USA x Trust with Core Covariates

reg prc2_DV_main_dichot i.prc2_treat_usa##i.trust_fed_num i.prc2_treat_prc 		///
	i.prc2_mancheck `demographics' `technical', robust

est sto prc2_m7_ols
local prc2_m7_olsN = `e(N)'

*** OLS Coefficient Graph Experiment 2
coefplot 																		///
		(prc2_m2_ols,	label(Base (`prc2_m2_olsN')))							///
		(prc2_m7_ols	,label(Interaction (`prc2_m7_olsN'))) 					///
		, xline(0,lcolor(black))												///
		order(*prc2_treat_usa *prc2_treat_prc *trust_fed_num *prc2_treat_usa#*)	///
		headings(2.prc2_treat_usa = "{bf:State Dept Reaction}"					///
				2.prc2_treat_prc = "{bf:China Reaction}"						///
				2.trust_fed_num = "{bf:Trust in Federal Govt}"					///
				2.prc2_treat_usa#2.trust_fed_num  = "{bf:State Dept x Trust}" 	///
				1.threat_prc_2  = "{bf:Threat Perception}"						///
				2.prc2_treat_prc#1.threat_prc_2  = "{bf:Reaction x Threat}"		///
				?.prc2_mancheck = "{it:Covariates}"								///
				)																///
		title("{bf:B:} {it: Support for Restrictions by State Dept.}"			///
				"{it:and PRC Reactions to State Initiative}",	///
				span justification(left) size(medsmall))						///
		xtitle("OLS Coefficients", size(small))									///
		coeflabels(, interaction(" x ") labsize(small)) 						///
		legend(rows(2) pos(11) ring(0) size(vsmall) linegap(*.5) region(color(none))) 							///
		drop(*cons *.mobile hispanic white female								/// 
				*.college *.pid3alt *mancheck age)								///
		name(g_exp2_ols_short,replace) 											///
		note("Full model includes survey mode, ethnicity, race, gender, education, party ID, ""manipulation check, and age.", size(vsmall) span)

* For interpretation
est restore prc2_m7_ols
margins prc2_treat_usa#trust_fed_num

mplotoffset ///
	, title("{bf: C:} {it:Predicted Support for Restrictions by State Dept}" "{it:Reaction and Trust in Federal Government}" ///
		, justification(left) span size(medsmall)) 					///
	name(g_exp2_interact, replace) legend(off) 									///
	text(.23 1.25 "A little", color(eltblue)) 									///
	text(.47 1.73 "No trust at all", color(cranberry)) 								///
	text(.45 1.2 "A lot", color(darkgray)) 										///
	fysize(36)	///
	ytitle("Predicted share of respondents approving", size(vsmall))			///
	note("Calculated from Interaction model in Panel B.", span size(vsmall))			///
	yla(.2 "20" .3 "30" .4 "40" .5 "50" .6 "60")								///
	plot1opts(lpattern(dash))													///
	xtitle("State Dept Reaction")
	
gr combine g_exp2_ols_short g_exp2_interact										///
	, rows(2) name(g_exp2_temp, replace)

gr combine g_exp2_summary g_exp2_temp											///
	, rows(1)  xsize(9) ysize(10) 				
	/// title("{bf:Experiment 2:} State Dept. caution elicits contrasting " ///
	/// "responses by trust in federal government"			///
	///	, justification(left) size(medsmall))
	
gr export "${MyProject}/PAPER Figure 4.pdf", replace
		



reg prc2_DV_main_dichot i.prc2_treat_usa##i.trust_fed_num i.prc2_treat_prc  	///
state_control_match	///
	i.prc2_mancheck `demographics' `technical' if small_state == 0 & pid3 != 1, robust

est sto prc2_statematch		
		
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
* Logit
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 

****** Demographics

logit prc2_DV_main_dichot i.prc2_treat_usa i.prc2_treat_prc i.prc2_mancheck  	///
	i.prc2_mancheck `demographics' `technical', robust

est sto prc2_m2_logit


*** USA x Trust with Core Covariates
logit prc2_DV_main_dichot i.prc2_treat_usa##i.trust_fed_num i.prc2_treat_prc  i.prc2_mancheck `demographics'  `technical', robust

est sto prc2_m7_logit

	
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
* Ologit
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 

****** Demographics

ologit prc2_DV_main i.prc2_treat_usa i.prc2_treat_prc i.prc2_mancheck 			///
	`demographics' `technical', robust

est sto prc2_m2_ologit


*** USA x Trust with Core Covariates

ologit prc2_DV_main i.prc2_treat_usa##i.trust_fed_num i.prc2_treat_prc  		///		
	i.prc2_mancheck `demographics' `technical', robust

est sto prc2_m7_ologit


esttab ///
	prc2_m2_ols  prc2_m7_ols 													///
	prc2_m2_logit  prc2_m7_logit 												/// 
	prc2_m2_ologit  prc2_m7_ologit 												/// 
	using "${MyProject}/APPENDIX Table A11.tex"			///
	, replace longtable lab noomit nobase  nogap	 							///
	se(%9.1f) b(%9.1f)	star(+ 0.10 * 0.051)									///
	nonotes addnote(Robust standard errors in parantheses)						///
	varwidth(30) 																///
	title("Experiment 2 Core Results \label{tab:exp2core}")						///
	mtitles("OLS" "OLS" "Logit" "Logit" "Ologit" "Ologit")						///
	order(2.prc2_treat_usa ?.prc2_treat_usa *.trust_fed_num*)					///
	drop(_cons *cut*) 															///
	refcat(	2.prc2_treat_usa "\textit{State Department Cue}"					///
			2.trust_fed_num "\textit{Trust in Fed Govt}"						///
			2.prc2_treat_usa#2.trust_fed_num "\textit{State Cue x Trust Feds}"	///
			2.prc2_treat_prc "\textit{PRC Reaction}"							///
			1.prc2_mancheck "\textit{Covariates}"								///
		, nolabel)


* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
*									mlogit									  *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 

****** Demographics

mlogit prc2_DV_main_trichot 													///
		i.prc2_treat_usa i.prc2_treat_prc i.prc2_mancheck 			///
	`demographics' `technical',	robust base(3)

est sto prc2_m2_mlogit


*** Basic Interaction, Hostile x Threat
	
mlogit prc2_DV_main_trichot 															///
		i.prc2_treat_usa##i.trust_fed_num i.prc2_treat_prc  		///		
	i.prc2_mancheck `demographics' `technical' , robust base(3)
est sto prc2_m7_mlogit


esttab 			///
	prc2_m2_mlogit  prc2_m7_mlogit ///
	using "${MyProject}/APPENDIX Table A12.tex"		///
	, nobase noomit nogap longtable lab unstack replace							///
	star(+ 0.10 * 0.05)		se(%9.1f) b(%9.2f)									///
	title("Experiment 2, Multinomial Logit \label{tab:exp2mlogit}")				///
		refcat(	2.prc2_treat_usa "\textit{State Department Cue}"				///
			2.prc2_treat_prc "\textit{PRC Cue}"									///
			1.threat_prc_2 "\textit{View of China Threat}"						///
			2.prc2_treat_usa#2.trust_fed_num "\textit{State Cue x Trust Feds}"	///
			2.prc2_treat_5prc "\textit{PRC Reaction"							///
			age "\textit{Covariates}"											///
			1.prc2_mancheck "\textit{Manipulation Check}"						///
		, nolabel)

********************************************************************************
* Experiment 2: Effects DV
********************************************************************************

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
* OLS
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
****** Demographics

reg prc2_DV_effects_dichot i.prc2_treat_usa i.prc2_treat_prc 					/// 
	i.prc2_mancheck `demographics' `technical', robust

est sto prc2_fx_m2_ols

*** USA x Trust with Core Covariates

reg prc2_DV_effects_dichot i.prc2_treat_usa##i.trust_fed_num i.prc2_treat_prc  	///
	i.prc2_mancheck `demographics' `technical', robust

est sto prc2_fx_m7_ols



****** Demographics

logit prc2_DV_effects_dichot i.prc2_treat_usa i.prc2_treat_prc i.prc2_mancheck  i.prc2_mancheck `demographics' `technical', robust

est sto prc2_fx_m2_logit


*** USA x Trust with Core Covariates
logit prc2_DV_effects_dichot i.prc2_treat_usa##i.trust_fed_num i.prc2_treat_prc ///
	i.prc2_mancheck `demographics'  `technical', robust

est sto prc2_fx_m7_logit


****** Demographics

ologit prc2_DV_effects i.prc2_treat_usa i.prc2_treat_prc i.prc2_mancheck 		///
	`demographics' `technical', robust

est sto prc2_fx_m2_ologit


*** USA x Trust with Core Covariates

ologit prc2_DV_effects i.prc2_treat_usa##i.trust_fed_num i.prc2_treat_prc  		///
	i.prc2_mancheck `demographics' `technical', robust

est sto prc2_fx_m7_ologit



esttab 																			///
	prc2_fx_m2_ols  prc2_fx_m7_ols 												///
	prc2_fx_m2_logit  prc2_fx_m7_logit 											/// 
	prc2_fx_m2_ologit prc2_fx_m7_ologit											///
		using "${MyProject}/APPENDIX Table A13.tex"	///
	, replace longtable lab noomit nobase  nogap	 							///
	se(%9.1f) b(%9.1f)	star(+ 0.10 * 0.051)									///
	nonotes addnote(Robust standard errors in parantheses)						///
	varwidth(40) 																///
	title("Experiment 2 Evaluation Results \label{tab:exp2fx}") 				///
	mtitles("OLS" "OLS" "Logit" "Logit" "Ologit" "Ologit")						///
	order(2.prc2_treat_prc 2.prc2_treat_usa 1.threat_prc_2 						///
			2.prc2_treat_prc#1.threat_prc_2)									///
	drop(_cons cut*) 									///
	refcat(	2.prc2_treat_usa "\textit{State Department Cue}"					///
			1.threat_prc_2 "\textit{View of China Threat}"						///
			2.prc2_treat_usa#2.trust_fed_num "\textit{State Cue x Trust Feds}"	///
			2.prc2_treat_5prc "\textit{PRC Reaction"							///
			1.prc2_mancheck "\textit{Covariates}"								///
		, nolabel)

		
***  Mediation

clonevar prc2_treat_prc_med = prc2_treat_prc
recode prc2_treat_prc_med (1=0) (2=1)
lab def prc2_treat_prclab2 0 "No Stance" 1 "PRC Hostile"
lab val prc2_treat_prc_med prc2_treat_prclab2

mediate (prc2_DV_main i.prc2_treat_usa##i.trust_fed_num		///		
	i.prc2_mancheck age female white hispanic college i.pid3alt i.mobile)		///
	(prc2_DV_effects_dichot) ///
	(prc2_treat_prc_med)


		
********************************************************************************
* Experiment 2: Subsidiary DVs
********************************************************************************


***** Discriminates: "The bill unfairly discriminates against people"
***** harmuni: "The bill would harm universities"
***** protectusa: "The bill would protect the U.S. against a threat"
***** science: "Science should be open and international"
***** screening: "There should be a rigorous screening process for foreign researchers rather than a complete ban"
***** America 1st: "U.S. universities should be for Americans first"

foreach var in 																	///
					discriminates 												///
					harmuni 													///
					protectusa 													///
					science 													///
					screening 													///
					america1st													///
			{
				clonevar prc2_`var'_100 = prc2_`var'_num
				replace prc2_`var'_100 = 100*prc2_`var'_100
				
			}

		
statplot ///
		prc2_screening_100 														///
		prc2_discriminates_100 													///
		prc2_science_100 														///
		prc2_harmuni_100 														///
		prc2_protectusa_100 													///
		prc2_america1st_100														///
		, name(gph_prc2_subsidifary, replace)									///
		title("Respondents' view of statements (Exp 2)")						///
		ytitle("Average percent agreeing")							

gr export "${MyProject}/APPENDIX Figure A4.pdf", replace


foreach var in 																	///
					discriminates 												///
					harmuni 													///
					protectusa 													///
					science 													///
					screening 													///
					america1st													///
			{

				local demographics i. prc2_mancheck age female white hispanic college i.pid3alt

				local technical i.mobile 
			

			*OLS
				quietly: reg prc2_`var'_num i.prc2_treat_usa i.prc2_treat_prc 	///
							, robust
				est sto prc2_`var'_m0_ols
				
				quietly: reg prc2_`var'_num i.prc2_treat_usa i.prc2_treat_prc	///
						`demographics' `technical' , robust
				est sto prc2_`var'_m2_ols
				
				quietly: reg prc2_`var'_num i.prc2_treat_usa##i.trust_fed_num 	///
				i.prc2_treat_prc 		///
				i.prc2_mancheck `demographics' `technical', robust
					est sto prc2_`var'_m7_ols
			
				quietly: reg prc2_`var'_num 	i.prc2_treat_usa##i.trust_fed_num 	///
									i.prc2_treat_prc##i.threat_prc_2  ///
									`demographics' `technical', robust
				est sto prc2_`var'_m8_ols
				
				quietly: reg prc2_`var'_num 	i.prc2_treat_usa##i.threat_prc_2 	///
									i.prc2_treat_prc##i.threat_prc_2  ///
									`demographics' `technical', robust
				est sto prc2_`var'_m9_ols			
					
			}

				
esttab ///
	prc2_discriminates_m2_ols prc2_harmuni_m2_ols prc2_science_m2_ols			///
	prc2_protectusa_m2_ols prc2_america1st_m2_ols prc2_screening_m2_ols			///
	using "${MyProject}/APPENDIX Table A14.tex"		///
	, replace lab noomit nobase nogap interaction(" x ") longtable					///
	varwidth(30) 	se(%9.1f) b(%9.1f)	star(+ 0.10 * 0.051)					///
	compress									///
	refcat(	2.prc2_treat_usa "\textit{State Department Cue}"					///
			2.prc2_treat_prc "\textit{PRC Cue}"									///
			1.threat_prc_2 "\textit{View of China Threat}"						///
			2.prc2_treat_usa#2.trust_fed_num "\textit{State Cue x Trust Feds}"	///
			2.prc2_treat_5prc "\textit{PRC Reaction"							///
			age "\textit{Covariates}"								///
			1.prc2_mancheck "\textit{Manipulation Check}"								///
		, nolabel) ///
	title("Models of Subsidiary DVs with Demographics \label{tab:exp2subsidiary}") 				
			
			
	
********************************************************************************
* 							Experiment 2: Het Effects						   *
********************************************************************************

*** Flo Rida (Florida) *********************************************************

reg prc2_DV_main_dichot ///
			i.prc2_treat_usa##florida 				///
			i.prc2_treat_prc##florida				 ///
			i.prc2_mancheck mobile age  white hispanic college i.pid3alt		///
			, robust
			
	est sto exp2_florida

coefplot 																		///
	exp2_florida																///
	, keep(*prc2_treat* *.florida* *.florida*)	xline(0)						///
	title("{it:Florida Residence}")												///
		coeflabels(, interaction(" x ") labsize(vsmall)) 						///
	name(g_exp2_florida, replace)		
		


*** Gender *********************************************************************

	reg prc2_DV_main_dichot ///
			i.prc2_treat_usa##female ///
			i.prc2_treat_prc##female			///
			i.prc2_mancheck mobile age  white hispanic college i.pid3alt		///
			, robust
			
	est sto exp2_female


coefplot 																		///
	exp2_female																	///
	, xline(0)	keep(*prc2_treat* *.florida*)									///
	name(g_female, replace)														///
		coeflabels(, interaction(" x ") labsize(vsmall)) 						///
	title("{it:Gender}")		


*** Degree *********************************************************************

reg prc2_DV_main_dichot ///
			i.prc2_treat_usa##college 		///
			i.prc2_treat_prc##college 				///
			i.prc2_mancheck mobile age female white hispanic  i.pid3alt			///
			, robust
	est sto exp2_college

coefplot 																		///
	exp2_college																///
	, keep(*prc2_treat* *.college* *.college*)	xline(0)						///
	name(g_college, replace)													///
		coeflabels(, interaction(" x ") labsize(vsmall)) 						///
	title("{it:Education}")		


*** Man Check ******************************************************************

reg prc2_DV_main_dichot ///
			i.prc2_treat_usa##prc2_mancheck		///
			i.prc2_treat_prc##prc2_mancheck			///
			i.prc2_mancheck mobile age female white hispanic college b2.pid3alt		///
			, robust
			
	est sto exp2_mancheck

coefplot 																	///
	exp2_mancheck															///
	, keep(*.prc2* )	xline(0)											///
	name(g_mancheck, replace)												///
		coeflabels(, interaction(" x ") labsize(vsmall)) 					///
	title("{it:Manipulation Check}")	

*** Mobile *******************************************************************

reg prc2_DV_main_dichot ///
		i.prc2_treat_usa##mobile ///
		i.prc2_treat_prc##mobile ///
		i.prc2_mancheck mobile age female white hispanic college i.pid3alt ///
		, robust
est sto exp2_mobile

coefplot 																		///
	exp2_mobile 																///
	, keep(*prc2_treat* *.mobile* *.mobile*) xline(0) 							///
	title("{it:Mobile Device}") 												///
		coeflabels(, interaction(" x ") labsize(vsmall)) 					///
	name(g_exp2_mobile, replace)

	
*** Race ***********************************************************************

reg prc2_DV_main_dichot ///
		i.prc2_treat_usa##honky ///
		i.prc2_treat_prc##honky ///
		i.prc2_mancheck mobile age female college i.pid3alt ///
		, robust
est sto exp2_honky

coefplot 																		///
	exp2_honky 																	///
	, keep(*prc2_treat* *.honky* *.honky*) xline(0) 							///
	title("{it:Race}") 															///
		coeflabels(, interaction(" x ") labsize(vsmall)) 					///
	name(g_exp2_honky, replace)	


*** PID ***********************************************************************

reg prc2_DV_main_dichot ///
		i.prc2_treat_usa##i.pid3alt ///
		i.prc2_treat_prc##i.pid3alt ///
		i.prc2_mancheck mobile age female white hispanic college ///
		if pid3alt == 0 | pid3alt == 2 ///
		, robust
est sto exp2_pid3

coefplot 																		///
	exp2_pid3 																	///
	, keep(*prc2_treat* *.pid3alt* *.pid3alt*) xline(0) 						///
	title("{it:Party ID}") 														///
		coeflabels(, interaction(" x ") labsize(vsmall)) 					///
	name(g_exp2_pid3, replace)		


*** Threat *********************************************************************

reg prc2_DV_main_dichot ///
		i.prc2_treat_usa##i.threat_prc_num ///
		i.prc2_treat_prc##i.threat_prc_num ///
		i.prc2_mancheck mobile age female white hispanic college i.pid3alt ///
		, robust
est sto exp2_threat

coefplot 																		///
	exp2_threat 																///
	, keep(*prc2_treat* *.threat_prc_num* *.threat_prc_num*) xline(0) 			///
	title("{it:Threat}") 														///
		coeflabels(, interaction(" x ") labsize(vsmall)) 					///
	name(g_exp2_threat, replace)	



* Combining them	
gr combine g_exp2_florida g_female g_college g_mancheck 						///
	g_exp2_mobile g_exp2_honky g_exp2_pid3 g_exp2_threat						///
	, rows(4) xsize(8) ysize(12) imargins(tiny)

gr export "${MyProject}/APPENDIX Figure A3.pdf", replace
				
gr close

log close
